package com.hao.springcloud.service;

import com.hao.springcloud.entities.CommonResult;
import com.hao.springcloud.entities.Payment;
import com.hao.springcloud.hystrix.OrderFeignServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "cloud-payment-service",fallback = OrderFeignServiceFallBack.class)
public interface OrderFeignService {

    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/info/ok/{id}")
    String getOk(@PathVariable("id") Integer id);

    @GetMapping("/payment/info/timeOut/{id}")
    String getTimeOut(@PathVariable("id") Integer id);
}
